home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / comm2 / arfnwsb1.lha / bin / postnews.demon < prev    next >
Text File  |  1995-07-27  |  2KB  |  90 lines

  1. /*
  2. ** Postnews Replacement Script
  3. ** GRn Can Now Post News :-)
  4. */
  5. Parse arg result
  6. a = 1
  7. art = word(result,1)
  8. art2 = word(result,3)
  9. alreadyinsertedfile = "FALSE"
  10. org = "The Martin Hunt Fan Club"
  11. if open(org,"env:organization","R") then
  12. do
  13.    organisation = readln(org)
  14.    call close(org)
  15. end
  16. if open(org,"env:organisation","R") then
  17. do
  18.    organisation = readln(org)
  19.    call close(org)
  20. end
  21.  
  22. if art2 ~="" then
  23. do
  24.   call open(file,art,"A")
  25.   call seek(file,0,"B")
  26.   newsgroup = readln(file)
  27.   a = 2
  28.   sig = 0
  29.   do while ~eof(file) & ~Sig
  30.     a = a + 1
  31.     if alreadyinsertedfile == "FALSE" then call insertfile2()
  32.     line.a = readln(file)
  33.     if compress(line.a) == "--" then call signature()
  34.     if upper(word(line.a,1)) == "FROM:" then a = a - 1
  35.   end
  36.   call close(file)
  37.   n = 1
  38.   quitflag = 0
  39.   do until quitflag
  40.      filename = "t:grn-file."||n
  41.      if ~exists(filename) then quitflag = 1
  42.      n = n + 1
  43.   end
  44.   art = filename
  45.   call open(file,art,"W")
  46.   call seek(file,0,"B")
  47.   line.1 = "To:"
  48.   line.2 = newsgroup
  49.   line.3 = "Organization: "||organisation
  50.   do i = 1 to a
  51.      call writeln(file,line.i)
  52.   end
  53.   call close(file)
  54. end
  55.  
  56. if a == 0 then address command "amitcp:bin/sendmail <" art "-f $USER -t mail2news@news.demon.co.uk"
  57. if a ~== 0 then address command "amitcp:bin/sendmail <" art "-f $user -t mail2news@news.demon.co.uk "
  58. exit
  59.  
  60. insertfile2:
  61.   call open(file2,art2,"R")
  62.   do while ~eof(file2)
  63.     a = a + 1
  64.     line.a = readln(file2)
  65.     if word(line.a,1) == "X-NewsSoftware:" then line.a = "X-NewsSoftware: GRn 2.1 19/2/94 (PostNews Fix 31/3/95 Martin Hunt)"
  66.   end
  67.   alreadyinsertedfile = "TRUE"
  68.   call close(file2)
  69. RETURN
  70.  
  71. Signature:
  72. parse var newsgroup title ": " name.1 "." name.2 "." name.3 "." name.4 "." name.5 "." name.6 "." name.7 "." name.8 "." name.9 "." name.10
  73. nameno = 1
  74. sigfile = "uunews:/"
  75. do while name.nameno ~== ""
  76.   sigfile = sigfile || name.nameno ||"/"
  77.   nameno = nameno + 1
  78. end
  79. sigfile = sigfile ||".sig"
  80. if open(sig,sigfile,"R") then
  81. do
  82.   do until eof(sig)
  83.     a = a + 1
  84.     line.a = readln(sig)
  85.   end
  86.   call close(sig)
  87.   sig = 1
  88. end
  89. return
  90.